package Demo;

abstract class Person {
	public abstract void show();
}
class Dancer extends Person{
	public void show(){
		System.out.println("Dancing!!!");
	}
}

interface PersonShow {
	void show();
}
class PersonDancerDemo{
	public static void main(String[] args){
		//多态
		Person p = new Dancer();
		p.show();
		System.out.println("----------------");

		//匿名内部类
		Person p2 = new Person() {
			@Override
			public void show() {
				System.out.println("hello 匿名内部类");
			}
		};
		p2.show();

		/*
		使用Lambda表达式实现匿名内部类的定义和调用
       */
		PersonShow p3 = () -> {
			System.out.println("hello lambda");
		};
		p3.show();
	}
}
